using System;

namespace SmartClientPlatform.RemoteClientBase
{
    public class ChangesTracker
    {
        public T Invoke<T>(Func<T> func)
        {
            currentChangesTracker = this;
            try
            {
                return func();
            }
            finally
            {
                currentChangesTracker = null;
            }
        }

        [ThreadStatic]
        public static ChangesTracker currentChangesTracker;

        internal static void OnDeserializedDataStore(DataStore dataStore)
        {
            //QDO: implement this
            //dataStore.Change += currentChangesTracker.DataStore_OnChange;
        }

        private void DataStore_OnChange()
        {
            throw new NotImplementedException();
        }
    }
}